<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var body = document.querySelector("body");

        function load(url, key) {
            return Promise.resolve({
                then: function (resolve, reject) {

                    resolve(url)

                }
            })
        }
        function next(url) {
            return new Promise(function (resolve, reject) {
                setTimeout(function () {
                    resolve(url)
                }, 0)

            })
        }

        Promise.race([load("https://img30.360buyimg.com/pop/s590x470_jfs/t1/162678/16/14835/49310/605c759dE50b809bd/e35251d27cb3437f.jpg")]).then(function (url) {
            var p = document.createElement("img");
            p.src = url;
            body.appendChild(p)


        }).catch(err => {
            console.log(err);
        })

    </script>
</body>

</html>